package entity

import (
	"time"
	"xr-game-server/core/constants/db"
	"xr-game-server/core/migrate"
)

const (
	TbActivity db.TbName = "activities"
)

const (
	ActivityStartFlag db.TbCol = "start_flag"
	ActivityEndFlag   db.TbCol = "end_flag"
)

// Activity 活动实体
type Activity struct {
	migrate.OneModel
	StartFlag bool `gorm:"default:0;comment:活动开始执行标志"`
	EndFlag   bool `gorm:"default:0;comment:活动结束执行标志"`
}

// NewActivity 创建一个新的活动实例
func NewActivity(activityId uint64) *Activity {
	ret := &Activity{}
	ret.ID = activityId
	ret.StartFlag = false
	ret.EndFlag = false
	ret.CreatedAt = time.Now()
	ret.UpdatedAt = time.Now()
	return ret
}

func initActivity() {
	migrate.AutoMigrate(&Activity{})
}
